﻿<controls:ChildWindow x:Class="Corina.Cydee.Apphub.LoginView"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                      xmlns:localViewmodel="clr-namespace:Corina.Cydee.Apphub.Viewmodels"
                      xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
                      Title="管理员登录"
                      Width="480"
                      Height="300"
                      FontSize="14"
                      Style="{StaticResource ChildWindowStyle}">
    <controls:ChildWindow.DataContext>
        <localViewmodel:LoginViewmodel />
    </controls:ChildWindow.DataContext>
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Margin="0,50,0,0" HorizontalAlignment="Center">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="200" />
                </Grid.ColumnDefinitions>
                <TextBlock VerticalAlignment="Center" Text="账户：" />
                <TextBox x:Name="txt_account"
                         Grid.Column="1"
                         Text="{Binding LoginAccount,
                                        Mode=TwoWay,
                                        UpdateSourceTrigger=PropertyChanged}" />
            </Grid>
            <Grid Margin="0,12">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock VerticalAlignment="Center" Text="密码：" />
                <PasswordBox x:Name="txt_password"
                             Grid.Column="1"
                             Password="{Binding LoginPassword,
                                                Mode=TwoWay,
                                                UpdateSourceTrigger=PropertyChanged}"
                             Style="{StaticResource PasswordBoxStyle}" />
            </Grid>
        </StackPanel>

        <StackPanel Grid.Row="1"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal">
            <Button Width="75"
                    Command="{Binding LoginCommand}"
                    Content="登录" />

            <Button Width="75"
                    Margin="12,0"
                    HorizontalAlignment="Right"
                    Click="CancelButton_Click"
                    Content="取消" />
        </StackPanel>

        <toolkit:BusyIndicator BusyContent="请稍候..." IsBusy="{Binding IsBusy}" />

    </Grid>
</controls:ChildWindow>